package datastruct
//优先级队列
type ph struct {
	a,b int
}
type Phs []ph

func (t Phs) Len() int {
	return len(t) //
}

func (t Phs) Less(i, j int) bool {
	return t[i].a < t[j].a
}

func (t Phs) Swap(i, j int) {
	t[i], t[j] = t[j], t[i]
}

func (t *Phs) Push(x interface{}) {
	*t = append(*t, x.(ph))
}

func (t *Phs) Pop() interface{} {
	n := len(*t)
	x := (*t)[n-1]
	*t = (*t)[:n-1]
	return x
}
